package com.system.service;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.system.dao.CollectDaoImpl;
import com.system.dao.ICollectDao;
import com.system.entity.CollectInfo;

public class CollectServiceImpl implements ICollectService {
	ICollectDao collectDao = new CollectDaoImpl();
	public String addCollectInfo(CollectInfo collectInfo) {
		try {
			return collectDao.addOrganizeInfo(collectInfo);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public String changeCollectInfo(CollectInfo collectInfo, String oldID) {
		try {
			return collectDao.changeCollectInfo(collectInfo, oldID);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public String deleteCollectInfo(String foodNum) {
		try {
			return collectDao.deleteCollectInfo(foodNum);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public List<CollectInfo> collectInfoList(String keyword) {
		List<CollectInfo> list = new ArrayList<CollectInfo>();
		try {
			list = collectDao.collectInfoList(keyword);
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

}
